package com.hhkj.study.admin.goods.controller;

import com.hhkj.study.admin.goods.entity.GoodsSku;
import com.hhkj.study.admin.goods.model.req.GoodsSkuInitReq;
import com.hhkj.study.admin.goods.model.req.GoodsSkuReq;
import com.hhkj.study.admin.goods.model.res.GoodsSkuRes;
import com.hhkj.study.admin.goods.service.biz.GoodsSkuBizService;
import com.ruoyi.common.annotation.PermissionPrefix;
import com.ruoyi.common.base.biz.controller.v3.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
* GoodsSkuController
*
* @author SERVER
* @since 2024-09-18
*/
@RestController
@PermissionPrefix("goods:goodsSku")
@Controller
@RequestMapping("/admin/goods/sku")
public class GoodsSkuController extends BaseController<GoodsSku, GoodsSkuReq, GoodsSkuRes, GoodsSkuBizService> {

    /**
     * 根据课程类型初始化sku
     * @param req
     * @return
     */
    @PostMapping("/init")
    public TableDataInfo init(@Validated @RequestBody GoodsSkuInitReq req) {
        return getDataTable(this.getBizService().init(req));
    }
}
